package com.bicon.botu.mall.goods.api;

import com.baomidou.mybatisplus.plugins.Page;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * <p> 用户定制api
 * </p>
 *
 * @author tao.zeng.
 * @since 2018/3/16.
 */
@RestController
@RequestMapping("/V2.0.0/api/userTrance")
public class UserTranceApiV2 extends BaseController {

    /**
     * 获取定制商品列表
     * http://192.168.10.32:4999/index.php?s=/10&page_id=1406
     *
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping("/getUserTranceList")
    public BaseResult getUserTranceList(Integer pageNo, Integer pageSize) {

        Page page = new Page(pageNo, pageSize);
        List<Map> maps = new ArrayList<>();
        Map map = new HashMap();
        map.put("productId", "xxx");
        map.put("picture", "xxx");
        map.put("isAttention", "xxx");
        map.put("relationId", "xxx");
        page.setRecords(maps);
        return sendResult200(page);
    }

    /**
     * 获取分享定制商品h5地址
     * http://192.168.10.32:4999/index.php?s=/10&page_id=1408
     *
     * @return
     */
    @GetMapping("/shareTrance")
    public BaseResult shareTrance() {
        Map map = new HashMap();
        map.put("shareAddress", "https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwj585KJmvDZAhWm5oMKHWZVD7MQjRx6BAgAEAU&url=https%3A%2F%2Fcrackberry.com%2Fandroid&psig=AOvVaw1KfOhVUxc8CXnNAdFCrDGw&ust=1521267727872235");
        return sendResult200(map);
    }

    /**
     * 获取角色的体测报告
     * http://192.168.10.32:4999/index.php?s=/10&page_id=1412
     *
     * @param userId
     * @return
     */
    @GetMapping("/getBodyCheckReportByRole")
    public BaseResult getBodyCheckReportByRole(String userId) {
        Map map = new HashMap();
        map.put("isEffective", 0);
        map.put("createDate", 1499324611000L);
        return sendResult200(map);
    }


}
